import request from '@/utils/request'
import * as URL from '@/constants/api'
// 根据id删除权限
export function delPermissions(id) {
  return request({
    url: `${URL.GET_PERMISSION}/${id}`,
    method: 'DELETE'
  }).then(res => res.data)
}
// 添加权限点
export function addPermissions(data) {
  return request({
    url: URL.GET_PERMISSION,
    method: 'POST',
    data
  }).then(res => res.data)
}
// 根据ID获取权限点详情
export function getPermissionDetail(id) {
  return request({
    url: `${URL.GET_PERMISSION}/${id}`,
    method: 'GET'
  }).then(res => res.data)
}
// 根据id更新权限点
export function editPermission(data) {
  return request({
    url: `${URL.GET_PERMISSION}/${data.id}`,
    method: 'PUT',
    data
  }).then(res => res.data)
}

